<!DOCTYPE html>
<html>
<head>
    <title>工厂订单</title>
    <#include "/header.html">
    <!-- 文件上传 -->
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/oss/style.css">
    <script type="text/javascript" src="${request.contextPath}/statics/plugins/oss/js/plupload.full.min.js"></script>
    <script type="text/javascript" src="${request.contextPath}/statics/plugins/oss/ziyun_library.js"></script>
</head>
<style>
    #rrapp{
        overflow-x: hidden;
    }
    a:link,a:visited{
        text-decoration:none;
    }

    .ui li {
        margin: 0;
        padding: 0;
        list-style: none
    }

    input {
        background: 0 0;
        border: none
    }

    html {
        overflow-x: hidden;
        font-family: "微软雅黑"
    }

    a {
        text-decoration: none
    }

    ol, ul {
        list-style-type: none
    }

    img, input, select {
        vertical-align: middle;
        outline: 0
    }

    a {
        text-decoration: none
    }

    .tab_head {
        background: #F3F3F3;
        padding: 10px;
    }

    .tab_cn {
        padding: 15px;
    }

    .tab_cn table {
        width: 100%;
        border-collapse: collapse;
    }

    .tab_cn table tr td {
        border: 1px solid #898989;
    }

    .tab_cn table tr td i {
        display: inline-block;
        padding: 25px 0px;
        text-align: center;
        width: 140px;
        border-right: 1px solid #898989;
    }

    .tab_cn table tr td span {
        display: inline-block;
    }

    .tab_cn .table tr td {
        padding: 5px;
        0px;
    }


</style>
<body>

<div id="rrapp" v-cloak>
    <!-- 列表 start -->
    <div v-show="showList">
        <!-- 查询 start -->
        <div class="grid-btn">
            <form class="form-inline" role="form">

                <a class="btn btn-default btn-sm" @click="reset"><i class="fa fa-refresh"></i></a>

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.orderId" @keyup.enter="query" placeholder="订单号">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.supplierName" @keyup.enter="query" placeholder="工厂名称">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.originalOrderId" @keyup.enter="query" placeholder="原始订单号">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <select class="form-control input-sm" v-model="q.productionStatus" @keyup.enter="query">
                        <option value="">生产状态</option>
                        <option value="1">待接单</option>
                        <option value="3">生产中</option>
                        <option value="4">生产完成</option>
                        <option value="6">已完结</option>
                    </select>
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input class="form-control input-sm" v-model="q.beginCreatetime" style="width: 120px;" @keyup.enter="query" @click = "checkBeginDate" placeholder="开始时间"/>
                    至
                    <input class="form-control input-sm" v-model="q.endCreatetime" style="width: 120px;"@keyup.enter="query" @click = "checkEndDate" placeholder="结束时间"/>
                </div>&nbsp;&nbsp;&nbsp;

                <a class="btn btn-default btn-sm"  @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
            </form>
        </div>
        <!-- 查询 end -->
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>

    </div>
    <!-- 列表 end -->

    <!-- 价格详情 start-->
    <el-dialog title="算价过程" :visible.sync="priceTableVisible" width="60%">

        <div class="tab_cn">
            <table>
                <tbody>
                <template v-for="item in view.quoteProductInfoList">
                    <tr>
                        <td style="width:10%; text-align:center;">
                            <div>{{item.partsName}}</div>
                        </td>
                        <td>
                            <div style="border-bottom:1px solid #898989;">
                                <i>具体参数</i>
                                <span v-if="item.basicParam != '' && item.basicParam != null">{{item.basicParam}}</span>
                                <span v-else></span>
                            </div>
                            <div>
                                <i>后工序参数</i>
                                <span v-if="item.craftParam != '' && item.craftParam != null">{{item.craftParam}}</span>
                                <span v-else></span>
                            </div>
                        </td>
                    </tr>
                </template>
                </tbody>
            </table>

            <table>
                <thead>
                <tr>
                    <td colspan="4" style="padding:10px;"></td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td style="width:8%; text-align:center;">后工序费用</td>
                    <td style="width:40%;padding:10px">{{view.totalCraftPrice}}</td>
                    <td style="width:8%; text-align:center;">利润</td>
                    <td style="width:40%;padding:10px">{{view.subtract}}</td>
                </tr>
                <tr>
                    <td style="width:8%; text-align:center;">印刷费用</td>
                    <td style="width:40%;padding:10px">{{view.totalPrintPrice}}</td>
                    <td style="width:8%; text-align:center;">总价</td>
                    <td style="width:40%;padding:10px;"><span style="color: red;font-weight: bold">{{view.totalTotalPrice}}</span>
                    </td>
                </tr>
                </tbody>
            </table>

            <!-- 商务印刷 -->
            <template v-if="view.printType == 'shangwuyinshua'">
                <table style="text-align:center; margin-top:10px;" class="table">
                    <tbody>
                    <tr>
                        <td>部件</td>
                        <td>印刷机</td>
                        <td>实际拼版尺寸</td>
                        <td>开纸类别</td>
                        <td>印刷方式</td>
                        <td>版数</td>
                        <td>拼版个数</td>
                        <td>每版印数</td>
                        <td>印刷纸张</td>
                        <td>纸价</td>
                        <td>每版印工费</td>
                        <td>后加工费用</td>
                        <td>印刷总费用</td>
                    </tr>

                    <template v-for="p in view.paperInfoList">
                        <tr>
                            <td>{{p.partName}}</td>
                            <td>{{p.printMachineName}}</td>
                            <td>{{p.cutSizes}}</td>
                            <td>{{p.kaiValue}}开</td>
                            <td>
                                <span v-if="p.printModeType != '' && p.printModeType != null">{{p.printModeType.nameType}}</span>
                            </td>
                            <td>{{p.editionNum}}</td>
                            <td>{{p.splitJointNum}}</td>
                            <td>{{p.printNum}}</td>
                            <td>{{p.paperNum}}</td>
                            <td>{{p.paperPrice}}</td>
                            <td>{{p.printPrice}}</td>
                            <td>{{p.craftPrice}}</td>
                            <td>{{p.costPrice}}</td>
                        </tr>
                    </template>
                    <tr>
                        <td colspan="13">{{view.attributeValueTypeMap}}</td>
                    </tr>
                    </tbody>
                </table>
            </template>

            <!-- 数码快印 -->
            <template v-else-if="view.printType == 'shumakuaiyin'">
                <table style="text-align:center; margin-top:10px;" class="table">
                    <tbody>
                    <tr>
                        <td>部件</td>
                        <td>印刷机</td>
                        <td>实际拼版尺寸</td>
                        <td>拼版个数</td>
                        <td>印数</td>
                        <td>纸张</td>
                        <td>纸价</td>
                        <td>组合单价</td>
                        <td>工艺费用</td>
                        <td>总费用</td>
                    </tr>

                    <template v-for="p in view.paperInfoList">
                        <tr>
                            <td>{{p.partName}}</td>
                            <td>{{p.printMachineName}{</td>
                            <td>{{p.cutSizes}{</td>
                            <td>{{p.splitJointNum}{</td>
                            <td>{{p.printNum}{</td>
                            <td>{{p.paperNum}{</td>
                            <td>{{p.paperPrice}{</td>
                            <td>{{p.printPrice}{</td>
                            <td>{{p.craftPrice}{</td>
                            <td>{{p.costPrice}{</td>
                        </tr>
                    </template>

                    <tr>
                        <td colspan="13">{{view.attributeValueTypeMap}}</td>
                    </tr>
                    </tbody>
                </table>
            </template>
        </div>

    </el-dialog>
    <!-- 价格详情 end-->

    <!-- 订单调价 start -->
    <el-dialog title="订单调价" :visible.sync="costFormVisible" width= "30%">
        <el-form :model="costForm" size="medium">
            <el-form-item label="调价：" label-width="80px">
                <el-input type="text" v-model="costForm.discount" auto-complete="off"></el-input>
                <div style="color: #909399">提示：要给顾客便宜100元，则输入"-100"；要提高订单价格100元，则输入"100"。</div>
            </el-form-item>
            <el-form-item label="备注：" label-width="80px">
                <el-input type="textarea" v-model="costForm.remark"></el-input>
                <div style="color: #F56C6C">注：请填写改价原因。</div>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button size="small" @click="costFormVisible = false">取 消</el-button>
            <el-button size="small" type="primary" @click="orderDiscount">确 定</el-button>
        </div>
    </el-dialog>
    <!-- 订单调价 start -->

    <!-- 用友订单号 start -->
    <el-dialog title="用友销售单号" :visible.sync="yonyouFormVisible" width= "30%">
        <el-form :model="yonyouForm" size="medium">
            <el-form-item label="备注：" label-width="80px">
                <el-input type="textarea" v-model="yonyouForm.yonyouOrderNo"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button size="small" @click="yonyouFormVisible = false">取 消</el-button>
            <el-button size="small" type="primary" @click="orderYonyou">确 定</el-button>
        </div>
    </el-dialog>
    <!-- 用友订单号 end -->

    <!-- 订单备注 start -->
    <el-dialog title="订单备注" :visible.sync="remarkTableVisible" width= "40%">
        <el-table :data="remarkTable" size="small">
            <el-table-column property="orRemarks" label="备注"></el-table-column>
            <el-table-column property="orCreateNameVal" label="创建人"></el-table-column>
            <el-table-column property="orCreateTime" label="创建时间"></el-table-column>
        </el-table>
    </el-dialog>
    <!-- 订单备注 end -->

</div>

<script src="${request.contextPath}/statics/js/modules/order/buyerfactoryorderinfo.js?_${.now?long}"></script>
</body>
</html>
